package chixing.day20.work5;

import chixing.day20.work4.Location;
import chixing.day20.work4.OrderPriority;
import chixing.day20.work4.OrderStatus;

public class Order {
    //orderId：订单编号
    //customerLocation：顾客位置（坐标 x,y）
    //distanceToStore：距离商家距离（公里）
    //orderPriority：订单优先级（枚举：高、中、低）
    //expectedDeliveryTime：预计配送时长（分钟）
    //orderStatus：订单状态（枚举：待派单、配送中、已完成、已取消）
    private int orderId;
    private Location customerLocation;
    private double distanceToStore;
    private OrderPriority orderPriority;
    private int expectedDeliveryTime;
    private OrderStatus orderStatus;
    public Order(){
    }
    public Order(int orderId, Location customerLocation, double distanceToStore,
                 OrderPriority orderPriority, int expectedDeliveryTime) {
        this.orderId = orderId;
        this.customerLocation = customerLocation;
        this.distanceToStore = distanceToStore;
        this.orderPriority = orderPriority;
        this.expectedDeliveryTime = expectedDeliveryTime;
        this.orderStatus = OrderStatus.PENDING;

    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public Location getCustomerLocation() {
        return customerLocation;
    }

    public void setCustomerLocation(Location customerLocation) {
        this.customerLocation = customerLocation;
    }

    public double getDistanceToStore() {
        return distanceToStore;
    }

    public void setDistanceToStore(double distanceToStore) {
        this.distanceToStore = distanceToStore;
    }

    public OrderPriority getOrderPriority() {
        return orderPriority;
    }

    public void setOrderPriority(OrderPriority orderPriority) {
        this.orderPriority = orderPriority;
    }

    public int getExpectedDeliveryTime() {
        return expectedDeliveryTime;
    }

    public void setExpectedDeliveryTime(int expectedDeliveryTime) {
        this.expectedDeliveryTime = expectedDeliveryTime;
    }

    public OrderStatus getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(OrderStatus orderStatus) {
        this.orderStatus = orderStatus;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", customerLocation=" + customerLocation +
                ", distanceToStore=" + distanceToStore +
                ", orderPriority=" + orderPriority +
                ", expectedDeliveryTime=" + expectedDeliveryTime +
                ", orderStatus=" + orderStatus +
                '}';
    }

    public void completeDelivery() {
        orderStatus = OrderStatus.COMPLETED;
    }
}
